import http from ".."

enum api {
    captchaUrl = '/api/captcha/',
    loginUrl = '/api/admins/login/'
}

export interface loginParm {
    'username': string,
    'password': string,
    'captcha_id': string,
    'captcha': string
}

// 获取验证码接口
export async function getCaptchaApi() {
    return await http.get(api.captchaUrl)
}

// 登录接口
export async function loginApi(parms: loginParm) {
    return await http.post(api.loginUrl, parms)
}